package jersey.czjug;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

/**
 * Example resource class hosted at the URI path "/hello"
 */
@Path("/hello")
@Component
@Scope("singleton")
public class HelloResource {

    /**
     * Method processing HTTP GET requests, producing "text/xml" MIME media
     * type.
     *
     * @return String that will be send back as a response of type "text/xml".
     */
    @GET
    @Produces("text/xml")
    public String getXML() {
        return "<greeting>Hello world!</greeting>";
    }
}
